- page_title _("Gitea import")
- header_title _("New project"), new_project_path
- add_to_breadcrumbs s_('ProjectsNew|Import project'), new_project_path(anchor: 'import_project')

- if Feature.enabled?(:new_project_creation_form, current_user)
  #js-vue-import-gitea-project-root{ data: {
    back_button_path: new_project_path(anchor: 'import_project'),
    namespace_id: namespace_id_from(params) || @current_user_group&.id,
    form_path: personal_access_token_import_gitea_path
  } }
- else
  %h1.page-title.gl-text-size-h-display.gl-flex.gl-items-center
    .gl-flex.gl-items-center.gl-justify-center
      = sprite_icon('gitea', css_class: 'gl-mr-3', size: 48)
    = _('Import projects from Gitea')
  %hr

  %p
    - link_to_personal_token = link_to(_('personal access token'), 'https://docs.gitea.io/en-us/api-usage/#authentication-via-the-api')
    = _('To get started, please enter your Gitea host URL and a %{link_to_personal_token}.').html_safe % { link_to_personal_token: link_to_personal_token }

  = form_tag personal_access_token_import_gitea_path do
    = hidden_field_tag(:namespace_id, params[:namespace_id])
    .form-group.row
      = label_tag :gitea_host_url, _('Gitea host URL'), class: 'col-form-label gl-col-sm-2'
      .gl-col-sm-4
        = text_field_tag :gitea_host_url, nil, placeholder: 'https://gitea.com', class: 'form-control gl-form-input'
    .form-group.row
      = label_tag :personal_access_token, _('Personal access token'), for: :personal_access_token, class: 'col-form-label gl-col-sm-2'
      .gl-col-sm-4
        = password_field_tag :personal_access_token, nil, class: 'form-control gl-form-input'
    .form-actions
      = render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm) do
        = _('List your Gitea repositories')
